//
//  DiaryCell.m
//  NewNest
//
//  Created by hesiyao on 16/1/24.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "DiaryCell.h"

@implementation DiaryCell

- (void)dealloc
{
    [_imgView release];
    [_contentLabel release];
    [_userImgview release];
    [_userNameLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.userImgview = [[UIImageView alloc] init];
        [self.contentView addSubview:_userImgview];
        [_userImgview release];
        
        self.userNameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_userNameLabel];
        [_userNameLabel release];
        
        self.imgView = [[UIImageView alloc] init];
        [self.contentView addSubview:_imgView];
        [_imgView release];
        
        self.contentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_contentLabel];
        [_contentLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.userImgview.frame = CGRectMake(5, 5, self.contentView.frame.size.height / 6, self.contentView.frame.size.height / 6);
    _userImgview.layer.cornerRadius = _userImgview.frame.size.width / 2;
    _userImgview.clipsToBounds = YES;
    self.userNameLabel.frame = CGRectMake(10 + _userImgview.frame.size.width, 5, self.contentView.frame.size.width - 15 - _userImgview.frame.size.width, _userImgview.frame.size.height);
    self.contentLabel.frame = CGRectMake(5, _userImgview.frame.origin.y + _userImgview.frame.size.height + 5, self.contentView.frame.size.width - 5, self.contentView.frame.size.height / 5);
    _contentLabel.numberOfLines = 0;
    self.imgView.frame = CGRectMake(5, _contentLabel.frame.origin.y + _contentLabel.frame.size.height + 5, self.contentView.frame.size.width - 10, self.contentView.frame.size.height - 20 - self.contentView.frame.size.height / 6 - self.contentView.frame.size.height / 5);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
